package com.slz3.business.module.orderManagement.ordOrder.steward;

import com.slz3.business.module.orderManagement.ordOrder.domain.OrdOrder;
import com.slz3.business.module.orderManagement.ordOrder.domain.OrdOrderCondition;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

public class OrdOrderResponse {

    public static Mono<ServerResponse> add(ServerRequest req) {
        return req.bodyToMono(OrdOrder.class).flatMap(ordOrder ->
                OrdOrderResController.add(req, ordOrder)
        );
    }

    public static Mono<ServerResponse> delete(ServerRequest req) {
        return req.bodyToMono(OrdOrderCondition.class).flatMap(ordOrderCondition ->
                OrdOrderResController.delete(req, ordOrderCondition)
        );
    }

    public static Mono<ServerResponse> modify(ServerRequest req) {
        return req.bodyToMono(OrdOrder.class).flatMap(ordOrder ->
                OrdOrderResController.modify(req, ordOrder)
        );
    }


    public static Mono<ServerResponse> list(ServerRequest req) {
        return OrdOrderResController.list(req);
    }

    public static Mono<ServerResponse> info(ServerRequest req) {
        return OrdOrderResController.info(req);
    }

    public static Mono<ServerResponse> choice(ServerRequest req) {
        return OrdOrderResController.choice(req);
    }

    public static Mono<ServerResponse> auditSubmit(ServerRequest req) {
        return req.bodyToMono(OrdOrderCondition.class).flatMap(ordOrderCondition ->
                OrdOrderResController.auditSubmit(req, ordOrderCondition)
        );
    }

    public static Mono<ServerResponse> audit(ServerRequest req) {
        return req.bodyToMono(OrdOrderCondition.class).flatMap(ordOrderCondition ->
                OrdOrderResController.audit(req, ordOrderCondition)
        );
    }

    public static Mono<ServerResponse> auditReject(ServerRequest req) {
        return req.bodyToMono(OrdOrderCondition.class).flatMap(ordOrderCondition ->
                OrdOrderResController.auditReject(req, ordOrderCondition)
        );
    }

    public static Mono<ServerResponse> usingEnable(ServerRequest req) {
        return req.bodyToMono(OrdOrderCondition.class).flatMap(ordOrderCondition ->
                OrdOrderResController.usingEnable(req, ordOrderCondition)
        );
    }

    public static Mono<ServerResponse> usingDisable(ServerRequest req) {
        return req.bodyToMono(OrdOrderCondition.class).flatMap(ordOrderCondition ->
                OrdOrderResController.usingDisable(req, ordOrderCondition)
        );
    }   

}
